﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="Thksoft.Module.ApplyView.Apply.Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="L_UI">
<head id="Head1" runat="server">
    <meta charset="utf-8" />
    <title>资金集中管理平台</title>
    <link href="/CSS/Main.css" rel="stylesheet" />
    <link href="/App_Themes/MSN_Blue/default.css" rel="stylesheet" type="text/css" />
    <link href="/UserCotrols/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" />
    <style type="text/css">
        #mydiv0 {
            border: 2px solid #2894FF;
            border-radius: 15px;
            -moz-border-radius: 15px;
            background-color: #F0F0F0;
        }

        #mytable0 tr {
            height: 40px;
            line-height: 40px;
        }

        #mytable0 .jjzj_jjzj_righttd input {
            border: 1px soild blue;
        }
    </style>
</head>
<body>
    <div class="Window">
        <%
            var user = User1;
            var company = new BLL.Sys_CompanyBLL().Find(user.USER_COMPANY);

            var CompanyName = company.CMY_NAME;
            var key = Guid.NewGuid();
            //查询部门所有人
            var userIdStr = new BLL.Sys_UserBLL().GetUserIdByCompanyId((int)company.CMY_ID);
        %>
        <div id="<%=key %>" style="margin: 0 auto; padding: 10px; width: 740px;">
            <p style="text-align: center; font-weight: bold; font-size: medium; color: #2894FF">
                年度资金计划申请
            </p>
            <br />
            <div id="mydiv0" style="width: 100%; text-align: center; padding-top: 20px;">
                <input id="<%=key %>_CompanyId" type="hidden" value="<%=company.CMY_ID %>" />
                <input id="<%=key %>_BzId" type="hidden" value="<%=userIdStr %>" />
                <table id="mytable0" border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td class="jjzj_lefttd">
                            <img src="/App_Themes/MSN_Blue/Images/jjzj_gs.png" style="vertical-align: middle" />&nbsp;&nbsp;公&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;司：
                        </td>
                        <td class="jjzj_righttd">
                            <label>
                                <%=CompanyName %></label>
                        </td>
                        <td class="jjzj_lefttd">
                            <img src="/App_Themes/MSN_Blue/Images/jjzj_rq.png" style="vertical-align: middle" />&nbsp;&nbsp;日&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期：
                        </td>
                        <td class="jjzj_righttd">
                            <input id="<%=key %>_ApplyDate" placeholder="请选择日期" value="<%=DateTime.Now.Year.ToString() %>"
                                class="Wdate INPUT DATE" type="text" onclick=" WdatePicker({ dateFmt: 'yyyy' })" />
                            <span style="color: Red;">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="jjzj_lefttd">
                            <img src="/App_Themes/MSN_Blue/Images/jjzj_yw.png" style="vertical-align: middle" />&nbsp;&nbsp;编制依据及事由：
                        </td>
                        <td class="jjzj_righttd" colspan="3">
                            <input id="<%=key %>_Title" placeholder="请输入编制依据及事由" value="" class="INPUT MAX" style="width: 52.5%;" />
                            <span style="color: Red;">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="jjzj_lefttd">
                            <img src="/App_Themes/MSN_Blue/Images/jjzj_zh.png" style="vertical-align: middle" />&nbsp;&nbsp;编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;制&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;人：
                        </td>
                        <td class="jjzj_righttd" colspan="3">
                            <input id="<%=key %>_BzStr" placeholder="请点选编制人" value="<%=CompanyName %>所有部门" class="INPUT MAX"
                                style="width: 52.5%;" />
                            <span style="color: Red;">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="jjzj_lefttd">
                            <img src="/App_Themes/MSN_Blue/Images/jjzj_bz.png" style="vertical-align: middle" />&nbsp;&nbsp;备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：
                        </td>
                        <td colspan="3" class="jjzj_righttd">
                            <textarea id="<%=key %>_Remark" class="INPUT" style="margin-top: 10px; width: 95%; height: 60px;"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: center;" colspan="4">
                            <a id="<%=key %>_Lodding" style="color: blue;">加载默认项</a>
                            <button id="<%=key %>_Save" class="bt_css_s" type="button">
                                保存</button>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <script src="/Scripts/jquery.1.11.1.js" type="text/javascript"></script>
        <script src="/UserCotrols/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
        <script src="/UserCotrols/My97DatePicker/开发包/lang/zh-cn.js" type="text/javascript"></script>
        <script src="/Scripts/MyScript.js" type="text/javascript"></script>
        <script src="/Content/lib/layer/layer.js" type="text/javascript"></script>
        <script src="/Scripts/Tools.Module.js" type="text/javascript"></script>
        <script src="/Content/lib/vue/vue-2.5.17.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            $("#<%=key %>_Save").click(function () {
                var titileId = "<%=key %>_Title";
            var bzId = "<%=key %>_BzId";
            if ($("#" + titileId).val().trim() == "") {
                alert("编制依据及事由不能为空");
                return;
            }
            if ($("#" + bzId).val().trim() == "") {
                alert("请选择编制人");
                return;
            }
            if ($("#<%=key %>_ApplyDate").val().trim() == "") {
                alert("请选择资金申请年份");
                return;
            }
            var data = {};
            data.Type = "Year";
            data.Title = $("#" + titileId).val();
            data.BzId = $("#" + bzId).val();
            data.CompanyId = parseInt($("#<%=key %>_CompanyId").val());
            data.Year = $("#<%=key %>_ApplyDate").val();
            $.ajax({
                async: false,
                type: "POST",
                url: "/Module/ApplyView/ApplyHandler.ashx?MethodType=SubmitApplay&userid=<%=user.USER_ID %>",
                    data: JSON.stringify(data),
                    success: function (result) {
                        if (result.Type == 1) {
                            alert("申请成功");
                            return;
                        }
                        alert(result.Msg);
                        return;
                    }
                });
            });
        </script>
    </div>
</body>
</html>